package com.situ.mall.common.mapper;

import com.situ.mall.common.entity.Location;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author JavaWizard
 * @since 2023-09-22
 */
public interface LocationMapper extends BaseMapper<Location> {

    //添加地址
    @Insert("insert into location (member_id, province, city, area, address, consignee, tel) values (#{memberId},#{province},#{city},#{area},#{address},#{consignee},#{tel})")
    void addLocation(Location location);

    //查全部收货地址
    @Select("select * from location where member_id = #{memberId}")
    List<Location> selectByMemberId(Integer memberId);

}
